When i got the machine the y axis was faulty so it made more sense that as i intended to do a full retrofit i would be better off replacing both the drive and the motor. Then i realised there would be a mismatch in resolutions on the x and y which i thought would cause accuracy problems so i decided to replace both servos and drives on x and y. The mesa cards are capable of driving the control techniques drives you already have but i was intent on replacing them only because of the cost of repair if they went wrong. If or when the z axis developes a fault i will replace that too but only if i can afford it. Then after the x y and z where all working under linuxcnc i realised there was a fault on the spindax spindle drive which caused me even more problems. I ended up buying a vfd drive (no motor feedback) and fitted an encoder to the existing spindle motor to giveµ feedback for rigid tapping etc. For the toolchange I struggled with classic ladder and comp programming so ended up using a subprogram for each tool number which although not ideal it works well and its biderectional on the turret. So basically instead of going t1 m6 i would write o call to get tool 1. A lot of people wouldnt like that but it works and with the amount of time i have spent on it a solution was needed. Thats probably enough info for one message but i am happy to pass on any information and help that i can. The VFD i used was a Control Techniques commander sk2. This was a bargain on ebay brand new so thought it was worth a try. For the spindle index i made a pneumatic plunger going into a vee direct on the spindle. I tried doing it electronically using the encoder index but struggled so just went for the plunger in the end. It still needs a bit of tuning i think as it takes a long time to stop especially when its at 6000rpm (12000 motor rpm) but i am living with that as i am just happy to have it working. As for the estun servo motors they just bolted straight on and i purchased drive couplings from Zapp Automation that went from 19mm ballscrew diameter to 22mm motor shaft. They were taper lock too so didnt need to modify anything. I slowed the new servos to a max 2000rpm to match the existing z axis but that still gives 16000mm minute rapid which i am more than happy with. I chose the mesa cards after reading so much on these forums which i am so grateful for. I run the drives in analogue velocity mode as i wanted the best accuracy and feedback and although the pid tuning caused me many stressful times it was worth it. I think really i should do a comprehensive build log but hope ive covered most of your questions. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX M101 name/path/making it exe #!/bin/sh # M101 in your G code program will run the Linux commands in this # shell script "batch" file, passing the P and Q variables as command # line arguments. # give the command line arguments descriptive names P=$1 Q=$2 echo "M101 P$P Q$Q: put your code here" exit 0 Machine coordinates. These cannot be changed from gcode. You can access these with a "G53" override. G53 G0 X0 Y0 Z0 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX When I type in the command word for word as advised, it still comes back error message "invalid command name code. That is why I tried using M101 and M102 in place of code. If I assign spindle brake on off to pin 14, all the hardware works correctly. I am sure my file is in the correct directory becasue it runs through on the program when I run it. In the configuration file I set pin 14 out 01. I have tried all of the others with no luck. M101 #!/bin/bash # file to turn on paraport pin 14 to open the collet closer halcmd setp parport.0.pin-14-out True exit 0 M102 #!/bin/bash # file to turn off paraport pin 14 to open the collet closer halcmd setp parport.0.pin-14-out False exit 0 It is set to be an executable and in home /tim/emc/nc My command in the program test code(which I wrote) is simply M101 and M102. G20 f95 G1 X9.0000 Y2.0000 A11.0000 M 101 G1 X0.0000 Y0.0000 A0.000 M 102 I use a hobbycnc pro 4 axis driver board Forgive me for my lack of knowledge, I am still learning. This one thing has been the toughest so far, and the one thing that stops me from production. I have built this machine to manufacture a product I have invented, the entire thing has been a college course or two for me in the past 7 months. Any help is appreciated. Tim XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX M66 Wait on Input M66 P- | E- P- - specifies the digital input number from 0 to 3. E- - specifies the analog input number from 0 to 3. L- - specifies the wait mode type. Mode 0: IMMEDIATE - no waiting, returns immediately. The current value of the input is stored in parameter #5399 Mode 1: RISE - waits for the selected input to perform a rise event. Mode 2: FALL - waits for the selected input to perform a fall event. Mode 3: HIGH - waits for the selected input to go to the HIGH state. Mode 4: LOW - waits for the selected input to go to the LOW state. Q- - specifies the timeout in seconds for waiting. If the timeout is exceeded, the wait is interrupt, and the variable #5399 will be holding the value -1. The Q value is ignored if the L-word is zero (IMMEDIATE). A Q value of zero is an error if the L-word is non-zero. Mode 0 is the only one permitted for an analog input. M66 Example Lines M66 P0 L3 Q5 (wait up to 5 seconds for digital input 0 to turn on) M66 wait on an input stops further execution of the program, until the selected event (or the programmed timeout) occurs. It is an error to program M66 with both a P-word and an E-word (thus selecting both an analog and a digital input).In LinuxCNC these inputs are not monitored in real time and thus should not be used for timing-critical applications. The number of I/O can be increased by using the num_dio or num_aio parameter when loading the motion controller. See the Integrator’s Manual, Core Components Section, Motion subsection, for more information. Note M66 will not function unless the appropriate motion.digital-in-nn pins or motion.analog-in-nn pins are connected in your hal file to an input. Example HAL Connection net signal-name motion.digital-in-00 <= parport.0.pin10-in